const $http = window.$http;

// 角色列表
export function getRoleList (params) {
  return $http.request({ url: "/supervise/userRole/queryPage", params });
}

// 角色新增
export function addRoleList (params) {
  return $http.request({ method: 'post', url: "/supervise/userRole/add", data: params });
}

// 角色删除
export function delRoleList (id) {
  return $http.request({ method: 'delete', url: `/supervise/userRole/delete/${id}` });
}

// 角色编辑-角色停用-启用
export function editRoleList (params) {
  return $http.request({ method: 'put', url: "/supervise/userRole/edit", data: params });
}

// 角色详情
export function detailRoleList (id) {
  return $http.request({ method: 'GET', url: `/supervise/userRole/detail/${id}` });
}

// 获取所有权益菜
export function getTenantPermission (params) {
  return $http.request({ url: "/supervise/userRole/getTenantPermission", params });
}

// 获取当前角色权益菜单
export function getUserRolePermissionByRoleId (roleId) {
  return $http.request({ method: 'GET', url: `/supervise/userRole/getUserRolePermission/${roleId}` });
}

// 角色设置权益
export function setRoleMenu (params) {
  return $http.request({ method: 'put', url: "/supervise/userRole/setRoleMenu", data: params });
}

// 角色关联人员
export function setRoleUser (params) {
  return $http.request({ method: 'put', url: "/supervise/userRole/setRoleUser", data: params });
}

// 职务列表
export function getPostList (params) {
  return $http.request({ url: "/supervise/post/queryPage", params });
}

// 部门列表
export function getDepartList (params) {
  return $http.request({ url: "/supervise/depart/queryPage", params });
}
